package yl.hs.bmipfull.controllers.chart;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import yl.hs.bmipfull.controllers.ControllerBase;
import yl.hs.bmipfull.service.chart.IRawMaterialChartService;
import yl.hs.bmipfull.viewmodels.WebResult;

/**
 * @author 谢东
 * @apiNote
 * @since 2022-03-18 9:43 创建
 */
@Api(value = "图表中心-原材web接口",tags = "图表中心-原材")
@RestController
@RequestMapping(value = "/api/RawMaterialChart")
public class RawMaterialChartController extends ControllerBase {

    @Autowired
    IRawMaterialChartService rawMaterialChartService;


    @ApiOperation(value = "生产线切换仓库实时库存", notes = "生产线切换仓库实时库存")
    @RequestMapping(value = "/RealTimeInventory",method = RequestMethod.GET)
    public WebResult getRealTimeInventory() throws Exception {
        return  success("查询成功",rawMaterialChartService.getRealTimeInventory());
    }

    @ApiOperation(value = "原材库存（种类+名称+规格）", notes = "原材库存（种类+名称+规格）")
    @GetMapping("/materialInventory")
    public WebResult materialInventory() throws Exception {
        return success("查询成功", rawMaterialChartService.materialInventory());
    }


    @ApiOperation(value = "原材采购价格曲线", notes = "原材采购价格曲线")
    @RequestMapping(value = "/purchasepricebymonth",method = RequestMethod.GET)
    public WebResult getPurchasePriceByMonth() throws Exception {
        return  success("查询成功",rawMaterialChartService.getPurchaseByMonth());
    }
}
